Add structured Sphinx-based documentation scaffold (issue #61) - #230
Add structured Sphinx-based documentation scaffold (issue #61)#230varma1221 wants to merge 9 commits into
Conversation
|
Hi @joeloskarsson and @leifdenby |
|
Thank you for working on this @varma1221! Could you upload the resulting output somewhere so I could take a look? It would also be great if you could look into how to get this integrated with a ci action so that we can automatically push the rendered docs to readthedocs for example. I have tried to look at this before, but didn't finish it... The ideal would be that each PR had its own temporary URL where the rendered docs can be viewed. Is that possible? |
|
Thank you so much for the feedback, @leifdenby. Before I start on the CI integration, I want to make sure I understand the preferred setup. Is there already a ReadTheDocs project configured for neural-lam, or would creating that foundation (like a I ask because enabling per-PR preview URLs requires access to the ReadTheDocs admin dashboard, so I want to know what's already in place before wiring up the workflow. |
|
Hi @leifdenby, I've pushed the CI and Read the Docs integration.
Once the repository is connected on Read the Docs and pull request builds are enabled, each PR should automatically receive its own temporary preview URL via RTD's PR build feature. Let me know if this setup aligns with what you had in mind, and I'm happy to adjust if needed. |
|
@Mohit-Lakra from #272 has a very similar implementation and is already hosting the docs on his github page. Do you think you could cooperate on this issue and find a common solution? |
|
Hi @sadamov, thanks for the heads up. I've had a look at @Mohit-Lakra's PR #272 and his live demo - the sphinx-autoapi approach is technically stronger, particularly since it avoids the need to mock heavy dependencies at build time. I'm happy to collaborate. @Mohit-Lakra, would it make sense to make it combine efforts? I could contribute the |
|
hey @varma1221 — yeah that makes sense, the autoapi approach sidesteps the whole mock imports headache. your readthedocs config is solid though and the per-PR preview URL thing is something leif specifically asked about so it'd be good to bring that in. if you want to just send it over i'll integrate it and add you to the changelog, or we can figure out the best way to combine — either works for me 🙌 |
|
Following up - coordinating with @Mohit-Lakra to port the |
|
@varma1221 just doing some housekeeping. Did you complete your contribution to #272 so that this PR can be closed, or not yet? |
Describe your changes
This PR introduces a structured Sphinx-based documentation scaffold for Neural-LAM, addressing #61.
The idea was to build something that can actually grow rather than just showing that Sphinx works. The documentation is organized into clear sections (
introduction,installation,api) and uses Sphinx withautodoc,napoleon, andmyst_parserto generate API documentation directly from existing docstrings.Instead of documenting only the top-level package, this PR documents modules explicitly (
interaction_net,metrics,utils,vis,models,datastore,weather_dataset,train_model) making it easier to add new modules later.The configuration enables documentation builds without requiring the full ML training environment by using
autodoc_mock_importsfor heavy scientific and ML dependencies.While integrating Sphinx, module-level import side effects were observed (e.g., path construction and runtime-dependent operations). These may produce warnings during documentation builds. This PR does not modify core module behavior but establishes a stable documentation structure.
Documentation Dependencies
The following are required only for building documentation:
sphinxfuromyst-parserThese do not affect runtime training dependencies.
Issue Link
addresses #61
Type of change
Checklist before requesting a review
Checklist for reviewers
Each PR comes with its own improvements and flaws. The reviewer should check the following:
Author checklist after completed review
Checklist for assignee